package kr.co.casually.preference;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.preference.PreferenceManager;

public class ConcertPreferences {
	
	
	public final static String FIRST_SERVICE  = "FIRST_SERVICE";	// 최초 서비스 실행 여부
	public final static String NOTI_HOUR  = "NOTI_HOUR";	// 통지 받을 시간
	public final static String NOTI_MINUTE  = "NOTI_MINUTE";	// 통지 받을 분
	public final static String FACEBOOK_ACCESS_TOKEN  = "FACEBOOK_ACCESS_TOKEN";	// 통지 받을 분
	public static final String CURRENT_TAB = "CURRENT_TAB";
	public static void setupDefaults(SharedPreferences preferences) {
		Editor editor = preferences.edit();
		

		editor.commit();
	}
	
	// 서비스 최초 실행 여부
	public static void storeFirstService(Context context, boolean b) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		Editor editor = prefs.edit();
		editor.putBoolean(FIRST_SERVICE, b);
		editor.commit();
	}
	
	
	// 시간설정
	public static void storeNotiTime(Context context, int hour, int minute) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		Editor editor = prefs.edit();
		editor.putInt(NOTI_HOUR, hour);
		editor.putInt(NOTI_MINUTE, minute);
		editor.commit();
	}
	
	
	public static void storeFacebookAccessTooken(Context context, String token){
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		Editor editor = prefs.edit();
		editor.putString(FACEBOOK_ACCESS_TOKEN, token);
		editor.commit();
	}
	
	
	
	public static void storeCurrentTab(Context context, String tab) {
		SharedPreferences prefs = PreferenceManager
				.getDefaultSharedPreferences(context);
		Editor editor = prefs.edit();
		editor.putString(CURRENT_TAB, tab);
		editor.commit();
	}
	
	
	
	
	
}
